import Vue from 'vue'

// 时间戳——日期格式
Vue.filter("formatDate",(data,type)=>{
if (!data) {
return '- -'
}
data = String(data).length <= 10 ? data * 1000 : data;
const t = new Date(data);
const Y = t.getFullYear().toString().padStart(2,0);
const M = (t.getMonth()+1).toString().padStart(2,0);
const D = t.getDate().toString().padStart(2,0);
const h = t.getHours().toString().padStart(2,0);
const m = t.getMinutes().toString().padStart(2,0);
const s = t.getSeconds().toString().padStart(2,0);
return Y +'-'+ M +'-'+ D+' '+h+':'+m
})